package com.ty.day2.home;

import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/23 16:45
 */
public class Task2 {
    static String[] week = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
    static String[] w = {"星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"};

    public static void main(String[] args) {
        System.out.println("请输入第一个字母（判断星期几）");
        isWeek();
    }

    static void isWeek() {
        Scanner sc = new Scanner(System.in);
        while (true) {
            String s = sc.next();
            if (s.length() > 1) {
                System.out.println("字母别输入多了，重新来");
                continue;
            }
            if (s.equalsIgnoreCase("t")) {
                System.out.println("再来一个字母吧");
                s = sc.next();
                if (s.equalsIgnoreCase("h")) {
                    System.out.println("也许我已经知道你想输入星期几了" + week[3] + "," + w[3]);
                    return;
                }
                if (s.equalsIgnoreCase("u")) {
                    System.out.println("也许我已经知道你想输入星期几了" + week[1] + "," + w[1]);
                    return;
                }
                System.out.println("周一到周天没有以t" + s + "开头");
                return;
            }
            if (s.equalsIgnoreCase("s")) {
                System.out.println("再来一个字母吧");
                s = sc.next();
                if (s.equalsIgnoreCase("a")) {
                    System.out.println("也许我已经知道你想输入星期几了" + week[5] + "," + w[5]);
                    return;
                }
                if (s.equalsIgnoreCase("u")) {
                    System.out.println("也许我已经知道你想输入星期几了" + week[6] + "," + w[6]);
                    return;
                }
                System.out.println("周一到周天没有以s" + s + "开头");
                return;
            }
            if (s.equalsIgnoreCase("m")) {
                System.out.println("也许我已经知道你想输入星期几了" + week[0] + "," + w[0]);
                return;
            }
            if (s.equalsIgnoreCase("w")) {
                System.out.println("也许我已经知道你想输入星期几了" + week[2] + "," + w[2]);
                return;
            }
            if (s.equalsIgnoreCase("f")) {
                System.out.println("也许我已经知道你想输入星期几了" + week[4] + "," + w[4]);
                return;
            }
            System.out.println("第一个字母都不对哦,重新来");
        }
    }
}
